/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.jr2tecnologia.model.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ronildo
 */
@Entity
@Table(name = "carrier")
@NamedQueries({
    @NamedQuery(name = "Carrier.findAll", query = "SELECT c FROM Carrier c"),
    @NamedQuery(name = "Carrier.findByPkCarrier", query = "SELECT c FROM Carrier c WHERE c.pkCarrier = :pkCarrier"),
    @NamedQuery(name = "Carrier.findByCode", query = "SELECT c FROM Carrier c WHERE c.code = :code"),
    @NamedQuery(name = "Carrier.findByName", query = "SELECT c FROM Carrier c WHERE c.name = :name")})
public class Carrier implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "pk_carrier")
    private Long pkCarrier;
    @Basic(optional = false)
    @Column(name = "code")
    private long code;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "carrier")
    private List<Modem> modemList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "carrier")
    private List<SmsSend> smsSendList;

    public Carrier() {
    }

    public Carrier(Long pkCarrier) {
        this.pkCarrier = pkCarrier;
    }

    public Carrier(Long pkCarrier, long code, String name) {
        this.pkCarrier = pkCarrier;
        this.code = code;
        this.name = name;
    }

    public Long getPkCarrier() {
        return pkCarrier;
    }

    public void setPkCarrier(Long pkCarrier) {
        this.pkCarrier = pkCarrier;
    }

    public long getCode() {
        return code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Modem> getModemList() {
        return modemList;
    }

    public void setModemList(List<Modem> modemList) {
        this.modemList = modemList;
    }

    public List<SmsSend> getSmsSendList() {
        return smsSendList;
    }

    public void setSmsSendList(List<SmsSend> smsSendList) {
        this.smsSendList = smsSendList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pkCarrier != null ? pkCarrier.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Carrier)) {
            return false;
        }
        Carrier other = (Carrier) object;
        if ((this.pkCarrier == null && other.pkCarrier != null) || (this.pkCarrier != null && !this.pkCarrier.equals(other.pkCarrier))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.jr2tecnologia.model.entity.Carrier[pkCarrier=" + pkCarrier + "]";
    }

}
